package com.lemon.smartsafetynew.util.device;

import com.lemon.smartsafety.R;
import com.lemon.smartsafetynew.entity.device.DeviceBo;

/**
 * Created by Andrew on 2017/9/15.
 */

public class DeviceUtils {

    public static String[] deviceStatus = new String[]{
            "启用", "保养", "维修", "报废", "未启用", "停用"
    };

    public static Integer[] deviceStatusBgRes = new Integer[]{
            R.drawable.drawable_app_blue, R.drawable.drawable_app_green, R.drawable.drawable_app_yellow,
            R.drawable.drawable_app_grey, R.drawable.drawable_app_light_blue, R.drawable.drawable_app_red
    };

    public static int getStatus(String status) {

        int id = 0;

        if(DeviceBo.DeviceStatus.enable.getValue().equals(status)) {
            id = 0;
        } else if(DeviceBo.DeviceStatus.maintain.getValue().equals(status)) {
            id = 1;
        } else if(DeviceBo.DeviceStatus.service.getValue().equals(status)) {
            id = 2;
        } else if(DeviceBo.DeviceStatus.scrap.getValue().equals(status)) {
            id = 3;
        } else if(DeviceBo.DeviceStatus.not_enabled.getValue().equals(status)) {
            id = 4;
        } else if(DeviceBo.DeviceStatus.disable.getValue().equals(status)) {
            id = 5;
        }

        return id;
    }

}
